﻿using Microsoft.Extensions.Logging;
using Warehouse.Services.Repository;
using WCS.Entities;

namespace WCS.Services.CommandService.Stacker
{
    [Command(RobotStates = RobotStatus.Idle, TaskStates = TaskState.Complete, IsCheckedDistance = false)]
    public class StackerFinishedCommand : BaseCommand
    {
        public StackerFinishedCommand(ILogger<BaseCommand> logger, Repository<Job> basicTaskRepository) : base(logger, basicTaskRepository)
        {

        }

        protected override Task<bool> Dock(TransferPort port, CommandAttribute attribute)
        {
            //写入AGV值
            var result = port.BelongDevice.Operation.Write(port.AgvAddress, (short)3);
            return Task.FromResult(result.IsSucceed);
        }
    }
}
